<template>
	<view class="home-container">
		<NavBar ></NavBar>
		<TabBar :lableList="lableList" @changeActiveIndex="handleIndex" :activeIndex="currIndex"></TabBar>
		<articleContainer :lableList="lableList" @changeActiveIndex="handleIndex" :currentIndex="currIndex"></articleContainer>
	</view>
</template>

<script>
	import {getLableList} from "../../Ajax/api/interface/home.js"
 	// 对于同名组件不需要导入
	export default {
		data() {
			return {
				title: 'Hello',
				lableList:[],
				currIndex:0
			}
		},
		async beforeCreate() {
			const res = await this.$http.getLableList();
			this.lableList = res;
		},
		methods: {
			handleIndex(index){
				this.currIndex = index;
				console.log(index);
			},
			
		}
	}
</script>

<style scoped>
	.home-container{
		display: flex;
		flex-direction: column;
		height: 100%;
	}
	uni-page-body{
		height: 100%;
	}
</style>
